import 'package:flutter/material.dart';
import 'package:FlutterReader/page/settings/AboutSetting.dart';
import 'package:FlutterReader/page/settings/FindSetting.dart';
import 'package:FlutterReader/page/settings/GroupItem.dart';
import 'package:FlutterReader/page/settings/LanguageSetting.dart';
import 'package:FlutterReader/page/settings/NetworkSetting.dart';
import 'package:FlutterReader/page/settings/ReadSetting.dart';
import 'package:FlutterReader/page/settings/StorageSetting.dart';
import 'package:FlutterReader/page/settings/ThemeSetting.dart';

import '../generated/l10n.dart';

class SettingsPage extends StatefulWidget {
  const SettingsPage({super.key});

  @override
  State<SettingsPage> createState() => _SettingsPageState();
}

class _SettingsPageState extends State<SettingsPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(S.current.setting)),
      body: GroupSetting(
      children: <Item>[
        Item.text(
          title: "发现",
          // subtitle: "子标题子标题",
          icon: const Icon(Icons.explore),
          description: "信息展示与屏蔽",
          goto: FindSetting,
        ),
        Item.text(
          title: "阅读",
          // subtitle: "子标题子标题",
          icon: const Icon(Icons.book),
          description: "阅读设置",
          goto: ReadSetting,
        ),
        Item.text(
          title: "外观",
          // subtitle: "子标题子标题",
          icon: const Icon(Icons.format_paint),
          description: "主题颜色",
          goto: ThemeSetting,
        ),
        Item.text(
          title: "应用",
          // subtitle: "子标题子标题",
          icon: const Icon(Icons.apps_outlined),
          description: "本地存储",
          goto: StorageSetting,
        ),
        Item.text(
          title: "网络",
          // subtitle: "子标题子标题",
          icon: const Icon(Icons.network_check),
          description: "配置网络",
          goto: NetworkSetting,
        ),
        Item.text(
          title: "关于",
          // subtitle: "子标题子标题",
          icon: const Icon(Icons.new_releases_outlined),
          description: "开发信息",
          goto: AboutSetting,
        ),
        Item.text(
          // title: "语言",
          title: S.of(context).settings_language,
          // subtitle: "子标题子标题",
          icon: const Icon(Icons.language_outlined),
          description: "语言配置",
          goto: LanguageSetting,
        ),
        // Item.leading("未使用的"),
        // Item.switcher(
        //   title: "偏好设置",
        //   subtitle: "子标题子标题",
        //   icon: const Icon(Icons.heart_broken),
        //   value: true,
        // ),
        // Item.notification(
        //   title: "信息提示",
        //   description: "1.0.0",
        //   icon: const Icon(Icons.question_mark),
        // ),
        // Item.spacer(),
        // Item.customize(
        //   Container(
        //     height: 100,
        //     color: Colors.grey[600],
        //     alignment: Alignment.center,
        //     child: const Text("这是自定义布局"),
        //   ),
        // ),
      ]),
    );
  }
}
